{math equation="60/x" x=$SlidesList.slides|@count assign=step}

<script type="text/javascript"> 
	$(document).ready(function(){
		$("div.index div.slider div").each(function(i){
			if(i>0) {
				$(this).hover(
					function() {
						for(d=1;d<=i;d++) {
							var Src = $("div.index div.slider div:eq("+d+")");
							if(d=={$SlidesList.slides|@count}) {
								var Left = $(window).width();
							} else {
								var Offset = $(Src).next().offset();
								var Left = Offset.left;
							}
							$(Src).css("left",Left-$(this).width());
						}
					},
					function() {
						for(d=1;d<=i;d++) {
							var Src = $("div.index div.slider div:eq("+d+")");
							$(Src).css("left",d*{$step}+30+"%");
						}
					}
				);
			}
		});
	});
</script> 

<div class="index"> 
	<div class="slider"> 
	
		<div class="slide0">
			<span><span><span class="{$SlidesList.main.styleclass}" {if $SlidesList.main.imagepath}style="background:url({$SlidesList.main.imagepath}) top left no-repeat"{/if}>
				<span class="textblock">
					{$SlidesList.main.slidetext}
				</span>
			</span></span></span>
		</div>
		
		{foreach from=$SlidesList.slides item=data name=foo}
		
			<div class="slide-block" style="left:{math equation="40+x*y" x=$smarty.foreach.foo.index y=$step}%">
				<span><span><span class="slide-content color-{$data.styleclass}">
					{if $data.slidetype=="text"}
						{$data.slidetext}
						<a class="link" href="{$data.url}">{$data.urltext}</a>
					{else if $data.slidetype=="news"}
						<h4>{$translate->_("Новости компании")}</h4>
						{foreach from=$data.newslist item=item}
							<p>
								<span class="newsdate">{$item.pubdate|date_format:"%d.%m.%y"}</span>
								<a href="{$cnf.baseurl}{$item.fullpath}{$item.resourceid}.html">{$item.resourcename}</a>
							</p>
						{/foreach}
						<a class="link" href="/news/">{$translate->_("Архив новостей")}</a>
					{/if}
				</span></span></span>
			</div>
		
		{/foreach}
		
		<div class="clear"></div> 
		
	</div>
</div> 